package org.jcc.servlet.encoding.page.writer;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/encoding/page/normalwriter/gbk")
public class EncodingNormalWriterGBK extends HttpServlet {

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Writer osw = new OutputStreamWriter(response.getOutputStream(), "gbk");
		String header = "<html><head><meta charset='gbk'></head><body>";
		String footer = "</body></html>";
		osw.write(header + "使用普通字符流，GBK" + footer);
		osw.flush();
	}
	
	private static final long serialVersionUID = 1L;
}
